package sj.System.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sj.System.dao.role.RoleMapper;
import sj.System.pojo.SysRole;
import sj.System.service.RoleService;

@Transactional

public class RoleServiceImpl implements RoleService {

    private RoleMapper roleMapper;
    public RoleMapper getRoleMapper() {
        return roleMapper;
    }

    public void setRoleMapper(RoleMapper roleMapper) {
        this.roleMapper = roleMapper;
    }

    /**
     * 根据ID修改角色信息
     *
     * @param role
     * @return
     */
    @Override
    public boolean updateRole(SysRole role) {
        if(roleMapper.updateRole(role)==1){
            return true;
        }
        return false;
    }

    /**
     * 根据角色id删除
     *
     * @param id
     * @return
     */
    @Override
    public boolean delRole(Integer id) {
        if(roleMapper.delRole(id)==1){
            return true;
        }
        return false;
    }
}
